function User(username, password) {
  this.username = username;
  this.password = password;
}

User.prototype.playFreeVideo = function () {
  console.log("观看免费视频");
};

function VIPUser(username, password, expires) {
  User.call(this, username, password);
  this.expires = expires;
}

VIPUser.prototype.playPayVideo = function () {
  console.log("观看付费视频");
};

// 相当于 VIPUser.prototype.__proto__ = User.prototype
Object.setPrototypeOf(VIPUser.prototype, User.prototype);

const vipUser = new VIPUser("zs", 123);
vipUser.playPayVideo();
vipUser.playFreeVideo();
